//
//  SDTagsView.h
//  SDEditTagsView
//
//  Created by shansander on 2017/7/27.
//  Copyright © 2017年 shansander. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "AppDefineHeader.h"
@class SDTagsView;
@class SDTagBaseControl;
@protocol SDTagsViewDelegate <NSObject>
@optional;


- (SDTagBaseControl *)tagView:(SDTagsView *)tagView withInputTagString:(NSString *)tagString atIndex:(NSInteger )index;

- (CGSize)tagView:(SDTagsView * )tagView sizeAtIndex:(NSInteger)index;


- (void)didAddTagString:(NSString *)tagString;

- (void)didChangeTagString:(NSString *)tagString withIndex:(NSInteger)index;


@end

@interface SDTagsView : UIView


/**
 tag的string的list
 */
@property (nonatomic, strong) NSMutableArray * tagList;

/**
 显示的标签的行数，1行，就是一直向后排列， 0 表示有多行了，然后高度根据Tags高度来改变
 */
@property (nonatomic, assign)NSInteger numberLinesofTags;


/**
 设置可以进行编辑tag
 */
@property (nonatomic, assign) BOOL editable;


/**
 输入框的文字Font
 define [UIFont systemFontOfSize:17];
 */
@property (nonatomic, strong) UIFont * editFont;


@property (nonatomic, strong) UIFont * tagFont;

@property (nonatomic, strong) UIColor * tagColor;

@property (nonatomic, strong) UIColor * tagSelectedColor;


/**
 边框间距
 */
@property (nonatomic, assign) UIEdgeInsets tagEdgeInsets;

/**
 列 的间距
 */
@property (nonatomic, assign) CGFloat columnspace;

/**
 row 的间距
 */
@property (nonatomic, assign) CGFloat rowspace;


/**
 每一行的Tag高度
 */
@property (nonatomic, assign) CGFloat unitTagLineHeight;

/**
 输入框的默认文字
 */
@property (nonatomic, strong) NSString * placeholder;


/**
 需要固定输入框里面最多能输入的文字
 define 10;
 */
@property (nonatomic, assign) NSInteger maxtagstringLength;


/**
 删除tag，通过软键盘的删除按钮来删除，
 define yes;
 */
@property (nonatomic, assign) BOOL can_delete_tag;


@property (nonatomic, weak) id<SDTagsViewDelegate>tagDelegate;


/**
 清除所有的标签
 */
- (void)clearAllTags;

/**
 添加多个标签
 */
- (void)addTags:(NSArray *)tags;

/**
 添加一个标签
 */
- (BOOL)addTagObject:(NSString * )tag;

/**
 删除一个标签
 */
- (void)rmTagObject:(NSString *)tagString;

@end
